package com.zrgk.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zrgk.bean.DeptBean;
import com.zrgk.service.DeptService;
import com.zrgk.util.PageUtil;

@Controller
@RequestMapping(value="/dept.do")
public class DeptController {
	@Autowired
	@Qualifier("deptService")
	private DeptService deptService;
	
	@RequestMapping(params="method=findDeptByPage")
	public String findDeptByPage(HttpServletRequest request){
		String nowPage = request.getParameter("page");
		
		PageUtil pageUtil=new PageUtil();
		if(nowPage!=null&&nowPage!=""){
			pageUtil.setNowPage(Integer.parseInt(nowPage));	
		}
		deptService.findDeptByPage(pageUtil);
		request.setAttribute("pageUtil", pageUtil);
		return "/html/resource/sys/org/list.jsp";
	}

	public DeptService getDeptService() {
		return deptService;
	}

	public void setDeptService(DeptService deptService) {
		this.deptService = deptService;
	}
	
	
}
